package com.sky.mapper;

import com.sky.entity.DishFlavor;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    /**
     * 添加菜品的口味信息
     *
     * @param dishFlavor 菜品的口味信息
     */
    @Insert("insert into dish_flavor (dish_id, name, value) VALUES (#{dishId},#{name},#{value})")
    void insert(DishFlavor dishFlavor);

    /**
     * 根据id查询菜品信息
     *
     * @param id 菜品id
     * @return 集合
     */
    DishVO getByIdWithFlavor(Long id);

    /**
     * 根据菜品id删除口味信息
     * @param id 菜品id
     */
    @Delete("delete from dish_flavor where dish_id = #{id}")
    void deleteByDishId(Long id);

    /**
     * 根据id查询菜品详情
     * @param id 菜品id
     * @return dishvo
     */
//    DishVO getByIdWithFlavor(Long id);
}
